package com.zh.demo.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zh.demo.model.Book;
import com.zh.demo.model.Teacher;
import com.zh.demo.service.EmpService;

@RestController
@RequestMapping("emp")
public class EmpController {
	
	@Resource
	private EmpService emps;
	@GetMapping("all")
	public @ResponseBody Object all() {
		return emps.findAll();
	}
	
	@RequestMapping("add")
	public int add(Book book) {
		return emps.add(book);
	}
	@RequestMapping("del")
	public boolean delete(@RequestParam int bNum) {
		return emps.delete(bNum);
		
	}
}
